package mnstudent.dataacesslayer;

import java.sql.ResultSet;

/**
 *
 * @author Administrator
 */
public class LoginDAL {

    private final DataExecuteUseStoreProcedure m_DataExecute;
    private String m_sqlCmd;

    public LoginDAL() {
        this.m_DataExecute = new DataExecuteUseStoreProcedure();
        this.m_sqlCmd = "";
    }

    public ResultSet getUser(String username, String pass) {
        ResultSet result = null;

        try {
            m_sqlCmd = "{Call GetEmployeeByUserPasswordFromDatabase(?, ?)}";
            String[] arrId = {username, pass};
            result = this.m_DataExecute.getDataFromDatabase(m_sqlCmd, arrId);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        return result;
    }
}
